Sleep disorder detection and treatment